Matthias Clasen [Sat, 29 Jun 2019 22:20:20 +0000 (22:20 +0000)]
constraint layout: Use stronger force for min size
We want our edit constraint to be strong enough to
overpower nat. size constraint, therefore use STRONG * 2.
Emmanuele Bassi [Mon, 1 Jul 2019 00:13:00 +0000 (01:13 +0100)]
Fix warnings from the introspection scanner
The name of the arguments of the functions must match the name of the
arguments in the documentation stanza.
Emmanuele Bassi [Mon, 1 Jul 2019 00:12:25 +0000 (01:12 +0100)]
Add gtkconstraintguide.h to the public headers
It needs to be introspected and installed.
Emmanuele Bassi [Mon, 1 Jul 2019 00:05:04 +0000 (01:05 +0100)]
Remove specialised API from GtkConstraint
Thet widget-based API for constraint target and source properties is
unused, and not really necessary.
Emmanuele Bassi [Mon, 1 Jul 2019 00:02:56 +0000 (01:02 +0100)]
Add missing documentation for GtkConstraint
Emmanuele Bassi [Sun, 30 Jun 2019 23:49:20 +0000 (00:49 +0100)]
docs: Add GtkConstraint and friends to the API reference
Emmanuele Bassi [Sun, 30 Jun 2019 23:48:59 +0000 (00:48 +0100)]
Document GtkConstraintGuide
Emmanuele Bassi [Sun, 30 Jun 2019 23:47:44 +0000 (00:47 +0100)]
Move the VFL error domain to a public header
Since the public API will use it to fill out GErrors, it needs to be
publicly available.
Matthias Clasen [Sun, 30 Jun 2019 13:25:30 +0000 (13:25 +0000)]
Add a constraint editor demo
This is an initial cut at providing a tool
for interactive exploration of constraints.
Emmanuele Bassi [Sun, 30 Jun 2019 22:59:04 +0000 (23:59 +0100)]
constraint layout: Notice when guides change
We need to queue a resize here.
Matthias Clasen [Sat, 29 Jun 2019 22:51:28 +0000 (22:51 +0000)]
Mark the layout as changed
We should mark the layout as changed when
constraints are added or removed.
Matthias Clasen [Sat, 29 Jun 2019 22:14:29 +0000 (22:14 +0000)]
constraint guide: Avoid redundant constraints
There is no point in creating a stay for nat
size when min == max. And no point in a constraint
for <= G_MAXINT either.
Matthias Clasen [Sat, 29 Jun 2019 22:13:41 +0000 (22:13 +0000)]
constraint guide: Fix initial property values
This was overlooked when the max-width/max-height/
strength properties were added.
Matthias Clasen [Sat, 29 Jun 2019 20:40:34 +0000 (20:40 +0000)]
constraint solver: Use GTK_NOTE
Allow using GTK_DEBUG=constraints to get debug
output from the constraints solver.
Matthias Clasen [Sat, 29 Jun 2019 17:38:36 +0000 (17:38 +0000)]
solver: Add private statistics api
No point in keeping these counters without
a way to show them.
Matthias Clasen [Sat, 29 Jun 2019 17:36:47 +0000 (17:36 +0000)]
constraint layout: Dont reset constraints in allocate
If trust our allocation algorithm, this can never
trigger (and in fact, it never does).
Matthias Clasen [Sat, 29 Jun 2019 14:21:58 +0000 (14:21 +0000)]
constraints: Add some internal apis
Checking if a set is empty or a singleton can
be done more efficiently than determining its size.
Matthias Clasen [Sat, 29 Jun 2019 14:18:23 +0000 (14:18 +0000)]
constraint guide: Make strength tweakable
The strength for the natural width can be used
as a tie-breaker to make instable systems behave
in a more predictable way. This can be seen
in the simple constraints demo in gtk-demo.
Matthias Clasen [Sat, 29 Jun 2019 14:15:42 +0000 (10:15 -0400)]
constraints demo: Update comments
Matthias Clasen [Sat, 29 Jun 2019 05:06:56 +0000 (05:06 +0000)]
constraint layout: freeze/thaw on mass ops
In measure and allocate we are potentially
changing quite a few constraints. Don't
optimize at every step.
Matthias Clasen [Sat, 29 Jun 2019 04:59:49 +0000 (04:59 +0000)]
constraints: Use better data structures
Use a GSequence for GtkVariableSet, to avoid
quadratic behavior.
Matthias Clasen [Fri, 28 Jun 2019 23:00:34 +0000 (23:00 +0000)]
constraint layout: Measure min/nat size separately
Only constraint the opposite direction if we
actually have a for_size, and measure natural
size after removing the edit constraints. With
these changes, the test that compares constraint
layout to grid layout passes.
Matthias Clasen [Fri, 28 Jun 2019 22:59:38 +0000 (22:59 +0000)]
constraint layout: Use stays for natural size
It makes more sense to treat the natural size
of both children and guides as stays, since
we want to meet these values as closely as we
can, under the circumstances.
Matthias Clasen [Fri, 28 Jun 2019 22:55:39 +0000 (22:55 +0000)]
constraint layout: Add debug output for guides
Print out the allocation we end up giving to
guides. This helps in making sense of the
allocations of the child widgets that these
guides relate to.
Matthias Clasen [Fri, 28 Jun 2019 22:54:28 +0000 (22:54 +0000)]
constraints demo: Give space a name
Lets call it 'space'.
Matthias Clasen [Fri, 28 Jun 2019 22:53:43 +0000 (22:53 +0000)]
constraint guide: Add a name property
We need to be able to print meaningful debug messages
regarding these objects, and eventually present them
in the inspector too.
Matthias Clasen [Fri, 28 Jun 2019 22:38:56 +0000 (22:38 +0000)]
constraint guide: Shorten names
Now that this is its own source file,
no need for these prefixes anymore.
Matthias Clasen [Fri, 28 Jun 2019 20:55:13 +0000 (20:55 +0000)]
constraint layout: Measure more correctly
Set up all constraints for minimum + natural
width + height when measuring, regardless
of the orientation we're measuring. Anything
else will lead to incorrect answers when
there are constraints that cut across
dimensions.
Matthias Clasen [Fri, 28 Jun 2019 19:51:37 +0000 (15:51 -0400)]
solver: Fix a copy/paste error
Matthias Clasen [Fri, 28 Jun 2019 16:59:39 +0000 (16:59 +0000)]
constraint solver: Fix repeat suggestions
We were not storing the previous value, causing
the first two suggestions to work, but not later
ones.
Fixes the test added in the previous commit.
Matthias Clasen [Fri, 28 Jun 2019 16:30:07 +0000 (16:30 +0000)]
Amend a constraint solver test
Make the 'repeat edit' test make more than to
suggestions in a single edit phase. It turns out
that this does not work, whereas just doing
two in a row does.
Matthias Clasen [Thu, 27 Jun 2019 22:06:53 +0000 (22:06 +0000)]
demo: Use constraint guide api
Use proper api to create and set up
the guide, and also try max-width.
Matthias Clasen [Thu, 27 Jun 2019 19:25:04 +0000 (19:25 +0000)]
Flesh out GtkConstraintGuide
This commit moves GtkConstraintGuide into its own
source files to avoid gtkconstraintlayout.c turning
too messy, adds max size properties and implements
getters and setters.
Matthias Clasen [Thu, 27 Jun 2019 19:32:56 +0000 (19:32 +0000)]
Drop an indirection
This struct is not really useful for just
a single hash table, and it gets in the way
of moving the guide code to its own file.
Matthias Clasen [Thu, 27 Jun 2019 18:49:54 +0000 (18:49 +0000)]
Detach guides on unroot
We don't want to leave constraints behind.
Matthias Clasen [Thu, 27 Jun 2019 18:40:15 +0000 (18:40 +0000)]
Simplify the guide implementation
Store the values and constraints in
arrays, to facilitate treating them
uniformly.
Emmanuele Bassi [Sun, 30 Jun 2019 09:36:33 +0000 (10:36 +0100)]
Return the list of constraints added via VFL description
Otherwise it's impossible to remove them.
Emmanuele Bassi [Sun, 30 Jun 2019 09:30:02 +0000 (10:30 +0100)]
Add method to remove all constraints from a layout
Emmanuele Bassi [Sat, 29 Jun 2019 18:04:29 +0000 (19:04 +0100)]
Add a C convenience function for VFL constraints
The dictionary-based function is convenient for language bindings, but C
developers will feel more at home with a variadic arguments list.
Emmanuele Bassi [Sat, 29 Jun 2019 17:50:55 +0000 (18:50 +0100)]
Add Constraints/VFL demo
Shows how to describe constraints using VFL instead of constructing
objects manually.
Emmanuele Bassi [Sat, 29 Jun 2019 17:32:56 +0000 (18:32 +0100)]
Allow adding constraints described through VFL
Emmanuele Bassi [Sat, 29 Jun 2019 17:03:42 +0000 (18:03 +0100)]
Add VFL parser for constraints
Constraints can be expressed with a compact syntax, called VFL (visual
format language).
Emmanuele Bassi [Sat, 29 Jun 2019 16:21:55 +0000 (17:21 +0100)]
Remove GtkConstraintVariable.set_prefix()
The prefix and name are set at construction time.
Matthias Clasen [Wed, 26 Jun 2019 03:35:10 +0000 (03:35 +0000)]
Add an interactive constraints demo
Matthias Clasen [Wed, 26 Jun 2019 02:35:15 +0000 (02:35 +0000)]
Make the constraints demo more interesting
Add a max size to the buttons, to force the
space to open up.
Matthias Clasen [Tue, 25 Jun 2019 23:38:32 +0000 (19:38 -0400)]
Add GtkConstraintGuide
This is meant to be a flexible space.
Emmanuele Bassi [Thu, 27 Jun 2019 17:26:19 +0000 (18:26 +0100)]
Use generic pointers for constraint targets
Since GtkWidget implements GtkConstraintTarget, we can omit the explicit
cast, and validate the type at run time.
Matthias Clasen [Tue, 25 Jun 2019 19:16:02 +0000 (15:16 -0400)]
Redefine constraints with GtkConstraintTarget
This is in preparation for allowing non-widgets
to act as constraint targets.
Matthias Clasen [Tue, 25 Jun 2019 19:05:29 +0000 (19:05 +0000)]
widget: Implement GtkConstraintTarget
Matthias Clasen [Tue, 25 Jun 2019 19:04:05 +0000 (15:04 -0400)]
Add GtkConstraintTarget
This is an marker interface that we will
use to accept other things that widgets
in constraints.
Emmanuele Bassi [Thu, 27 Jun 2019 16:37:09 +0000 (17:37 +0100)]
Notify a layout change when adding and removing constraints
Changing the set of constraints should cause a relayout.
Emmanuele Bassi [Thu, 27 Jun 2019 16:34:29 +0000 (17:34 +0100)]
Fix the opposite size measurement in GtkConstraintLayout
We cannot use the given "for size" when querying our children, because
the constraint layout has no idea about the opposite size of its
children until the layout is complete.
Additionally, we should only suggest an opposite size for the layout if
we have one, instead of suggesting a weak zero size.
Emmanuele Bassi [Thu, 27 Jun 2019 16:08:48 +0000 (17:08 +0100)]
Remove size constraints from ConstraintLayoutChild
The size constraints are transient to measurement and allocation, so
they don't really need to be stored inside the GtkLayoutChild subclass
created by a GtkConstraintLayout.
Matthias Clasen [Wed, 26 Jun 2019 02:30:31 +0000 (02:30 +0000)]
constraints: Make internal consistency required
The relations between left, right, width
and top, bottom, height are required for
internal consistency. It doesn't make sense
to ever drop these.
Changing the strength of these relations makes
my systems behave much more stable.
Matthias Clasen [Wed, 26 Jun 2019 03:40:03 +0000 (03:40 +0000)]
Add gtk_constraint_layout_remove_constraint
Otherwise, you can't do many interesting things.
Emmanuele Bassi [Thu, 27 Jun 2019 15:42:58 +0000 (16:42 +0100)]
Do not release reference on the subject of an expression
We don't own the reference in the first place.
Matthias Clasen [Thu, 27 Jun 2019 01:43:47 +0000 (01:43 +0000)]
constraints solver: Avoid critials
When the solver is finalized with existing
constraints, we end up with criticals when
the constraints ref finalize code calls
back into the hash table. Avoid that by
emptying the hash table beforehand.
Matthias Clasen [Wed, 26 Jun 2019 20:08:08 +0000 (20:08 +0000)]
constraint solver: Fix thawing
There was an obviously wrong precondition here.
Emmanuele Bassi [Mon, 17 Jun 2019 08:26:39 +0000 (09:26 +0100)]
Do not leak LayoutChild instances
Since the LayoutManager owns the LayoutChild it creates, it's also
responsible for mopping them up.
Emmanuele Bassi [Thu, 13 Jun 2019 18:33:36 +0000 (19:33 +0100)]
Add GtkConstraintLayout demo
Emmanuele Bassi [Tue, 9 Apr 2019 14:33:52 +0000 (15:33 +0100)]
Add GtkConstraintLayout
A layout manager using GtkConstraintSolver to measure and allocate
children.
Emmanuele Bassi [Mon, 10 Jun 2019 13:43:14 +0000 (14:43 +0100)]
Propagate rooting and unrooting widgets to layout managers
Layout managers may need to get access to data attached to the root of a
scene graph.
Emmanuele Bassi [Tue, 9 Apr 2019 13:22:19 +0000 (14:22 +0100)]
window: Create a GtkConstraintSolver
Implement the GtkRoot getter for GtkConstraintSolver.
Emmanuele Bassi [Tue, 9 Apr 2019 13:20:54 +0000 (14:20 +0100)]
Assign a GtkConstraintSolver to each GtkRoot
Constraints need to work across different parents, so it's better to
have a single constraint solver per top level.
Emmanuele Bassi [Tue, 9 Apr 2019 13:13:37 +0000 (14:13 +0100)]
Move the Root interface to a private header
We don't expect out of tree implementations of GtkRoot, and having the
interface structure private to the GTK code allows us to add virtual
functions involving private types.
Emmanuele Bassi [Tue, 9 Apr 2019 13:05:48 +0000 (14:05 +0100)]
Add constraint solver
GtkConstraintSolver is an implementation of the Cassowary constraint
solving algorithm:
http://constraints.cs.washington.edu/cassowary/
The Cassowary method allows to incrementally solve a tableau of linear
equations, in the form of:
x = y × coefficient + constant
with different weights, or strengths, applied to each one.
These equations can be used to describe constraints applied to a layout
of UI elements, which allows layout managers using the Cassowary method
to quickly, and efficiently, lay out widgets in complex relations
between themselves and their parent container.
Matthias Clasen [Sun, 30 Jun 2019 18:35:28 +0000 (18:35 +0000)]
Fix a crash in action muxer destruction
I've seen a crash when the action muxer gets
disposed during widget destroy, and tries to
disconnect from widget signals too late.
There is no real need to disconnect, since the
only time an action muxer is going away is when
its widget is destroyed, so just don't do it.
Timm Bäder [Sat, 29 Jun 2019 07:39:20 +0000 (09:39 +0200)]
transform: Add transform_bounds fast path for 2D_AFFINE transforms
E.g. anything involving a scale. This is important when e.g. scrolling
in the node list in the recorder, which scales every recorded node down
to fit in the list.
Timm Bäder [Sat, 29 Jun 2019 07:06:32 +0000 (09:06 +0200)]
Adwaita: Fix popover style
We add the .background class to the popover node now.
Timm Bäder [Sat, 29 Jun 2019 06:57:27 +0000 (08:57 +0200)]
gl renderer: Fix push/pop modelview behavior
Timm Bäder [Sat, 29 Jun 2019 06:53:36 +0000 (08:53 +0200)]
gl renderer: Remove some dead code
Timm Bäder [Sat, 29 Jun 2019 05:13:10 +0000 (07:13 +0200)]
gl renderer: Don't upload GL textures into the icon cache
Timm Bäder [Sat, 29 Jun 2019 05:12:10 +0000 (07:12 +0200)]
transform: Add skew parsing
Matthias Clasen [Fri, 28 Jun 2019 19:21:21 +0000 (19:21 +0000)]
Add another grid layout test
This one will be used for comparison
with constraint layouts.
Matthias Clasen [Fri, 28 Jun 2019 18:07:23 +0000 (18:07 +0000)]
Some more grid layout tests
Add testcases for spanning children and homogeneity.
Matthias Clasen [Fri, 28 Jun 2019 13:28:46 +0000 (13:28 +0000)]
Add a test for the grid layout manager
Test some obvious conditions. This is mainly
to test the waters for more intesting tests
with other layout managers later.
Matthias Clasen [Fri, 28 Jun 2019 12:40:25 +0000 (12:40 +0000)]
grid layout: Fix initial property values
Too bad that we don't cover layout children
in the default value test - it would have
caught this.
Jakub Steiner [Thu, 27 Jun 2019 10:15:51 +0000 (12:15 +0200)]
Adwaita: allow flat list row buttons to be flat
- Be more specific about the list row image buttons
Addresses corner case of https://gitlab.gnome.org/GNOME/gtk/issues/1748
Jakub Steiner [Thu, 27 Jun 2019 08:55:18 +0000 (10:55 +0200)]
Adwaita: lighten dark switch sliders
- addresses legibility concerns
Fixes https://gitlab.gnome.org/GNOME/gtk/issues/1819
Alex Monday [Thu, 27 Jun 2019 08:40:22 +0000 (10:40 +0200)]
Adwaita: Apply border-radius to .csd popovers
Fix popover_radius variable doesn't apply to .csd popover.
Closes https://gitlab.gnome.org/GNOME/gtk/issues/1984
Alex Monday [Thu, 27 Jun 2019 07:39:20 +0000 (12:39 +0500)]
Adwaita: Fix padding/rounding on submenus
- Apply menubar submenu style for .csd submenus;
- Remove child subemenu style (looks like it is inherited
from a parent).
Closes https://gitlab.gnome.org/GNOME/gtk/issues/1976
Jakub Steiner [Thu, 27 Jun 2019 08:27:28 +0000 (10:27 +0200)]
Adwaita: darken osd background for A:dark
- OSD background color was too close to $bg_color to make out outline
Fixes https://gitlab.gnome.org/GNOME/gtk/issues/1964
Matthias Clasen [Mon, 24 Jun 2019 19:52:12 +0000 (19:52 +0000)]
Merge branch 'master' into 'master'
Fix a typo
See merge request GNOME/gtk!960
Hodong Kim [Mon, 24 Jun 2019 18:42:40 +0000 (18:42 +0000)]
Fix a typo
Daniel Boles [Mon, 24 Jun 2019 17:00:57 +0000 (18:00 +0100)]
ShortcutsSection: Fix tiny grammar-o "in for"→"in"
Ask Hjorth Larsen [Mon, 24 Jun 2019 16:55:47 +0000 (18:55 +0200)]
Updated Danish translation of gtk-properties
Ask Hjorth Larsen [Mon, 24 Jun 2019 16:55:25 +0000 (18:55 +0200)]
Updated Danish translation of gtk
Matthias Clasen [Mon, 24 Jun 2019 16:10:03 +0000 (16:10 +0000)]
Merge branch 'no-varargs-activate' into 'master'
Add a non-varargs variant of activate_action
See merge request GNOME/gtk!959
Matthias Clasen [Mon, 24 Jun 2019 15:44:26 +0000 (11:44 -0400)]
Add a non-varargs variant of activate_action
I recently turned gtk_widget_activate_action()
into a varargs function. That is more convenient
from C, but we need a non-varargs variant for
bindings. So add the old API back, under the
name gtk_widget_activate_action_variant(),
with a rename-to annotation.
Emmanuele Bassi [Mon, 24 Jun 2019 15:13:15 +0000 (15:13 +0000)]
Merge branch 'issue-1961-master' into 'master'
Provide GdkMonitor:connector
See merge request GNOME/gtk!954
Emmanuele Bassi [Thu, 20 Jun 2019 15:09:28 +0000 (16:09 +0100)]
Set the monitor's connector under X11
Like we do on Wayland.
In this case, we copy it from the same source as the output name,
because it's going to match.
Emmanuele Bassi [Thu, 20 Jun 2019 14:55:58 +0000 (15:55 +0100)]
Relay the xdg_output.name to GdkMonitor
The xdg_output v2 interface has a `name` property that reflects the
output name coming from the compositor.
This is the closest thing we can get to a connector name.
Emmanuele Bassi [Thu, 20 Jun 2019 13:52:41 +0000 (14:52 +0100)]
Add getter for a monitor connector
The migration from GdkScreen's monitor API to GdkMonitor left out a way
to get the connector's name of a monitor.
While there's no real guarantee coming from the underlying graphics
system that the connector's name is stable, some system components may
use it to uniquely identify a monitor until the next plug in/out event.
Emmanuele Bassi [Mon, 24 Jun 2019 14:22:18 +0000 (14:22 +0000)]
Merge branch 'stack-realign' into 'master'
build: Do not use add_global_flags()
See merge request GNOME/gtk!958
Emmanuele Bassi [Mon, 24 Jun 2019 14:00:21 +0000 (15:00 +0100)]
build: Do not use add_global_flags()
It's almost always not what you want.
Daniel Mustieles [Mon, 24 Jun 2019 07:59:52 +0000 (09:59 +0200)]
Updated Spanish translation
Matthias Clasen [Sun, 23 Jun 2019 22:50:33 +0000 (22:50 +0000)]
Make gtk_widget_activate_action better
As a convenience API, this should be easy to use,
so don't expect callers to manually create a
variant, do it for them.
Update all callers.
Matthias Clasen [Sun, 23 Jun 2019 17:22:02 +0000 (17:22 +0000)]
widget: create parent muxers lazily
We need to create a muxer eagerly for every
widget that has class actions, since those
are otherwise missed in the action lookup
on the muxer side. But otherwise, there is
no reason to create parent muxers aggressively,
as long as we update the parent muxers on
root/unroot.
This reduces the number of muxers we create
in widget-factory from 210 to around 50.
Matthias Clasen [Sun, 23 Jun 2019 14:55:10 +0000 (14:55 +0000)]
window: Fix the default value of mnemonics-visible
They aren't visible, so why should the property
be TRUE?
Timm Bäder [Sun, 23 Jun 2019 07:58:26 +0000 (07:58 +0000)]
Merge branch '362-gtk-fileopen-dialog-need-filetype-mime-sort-option-2_GTK4' into 'master'
GtkFileChooser: add a sortable "Type" column
Closes #362
See merge request GNOME/gtk!874